import {
  GraphQLList,
  GraphQLObjectType,
  GraphQLSchema,
  GraphQLString,
  GraphQLInt,
  GraphQLFloat,
  GraphQLEnumType,
  GraphQLNonNull,
  GraphQLID
} from 'graphql';

export default new GraphQLObjectType({
  name: 'StockBasics',
  description: '股票基本面信息',
  fields: {
    code: {
      type: new GraphQLNonNull(GraphQLString),
      description: '代码'
    },
    name: {
      type: new GraphQLNonNull(GraphQLString),
      description: '名称'
    },
    industry: {
      type: GraphQLString,
      description: '所属行业'
    },
    area: {
      type: GraphQLString,
      description: '地区'
    },
    pe: {
      type: GraphQLFloat,
      description: '市盈率'
    },
    outstanding: {
      type: GraphQLFloat,
      description: '流通股本(亿)'
    },
    totals: {
      type: GraphQLFloat,
      description: '总股本(亿)'
    },
    totalAssets: {
      type: GraphQLFloat,
      description: '总资产(万)'
    },
    liquidAssets: {
      type: GraphQLFloat,
      description: '流动资产'
    },
    fixedAssets: {
      type: GraphQLFloat,
      description: '固定资产'
    },
    reserved: {
      type: GraphQLFloat,
      description: '公积金'
    },
    reservedPerShare: {
      type: GraphQLFloat,
      description: '每股公积金'
    },
    esp: {
      type: GraphQLFloat,
      description: '每股收益'
    },
    bvps: {
      type: GraphQLFloat,
      description: '每股净资'
    },
    pb: {
      type: GraphQLFloat,
      description: '市净率'
    },
    timeToMarket: {
      type: GraphQLInt,
      description: '上市日期'
    },
    undp: {
      type: GraphQLFloat,
      description: '未分利润'
    },
    perundp: {
      type: GraphQLFloat,
      description: '每股未分配'
    },
    rev: {
      type: GraphQLFloat,
      description: '收入同比(%)'
    },
    profit: {
      type: GraphQLFloat,
      description: '利润同比(%)'
    },
    gpr: {
      type: GraphQLFloat,
      description: '毛利率(%)'
    },
    npr: {
      type: GraphQLFloat,
      description: '净利润率(%)'
    },
    holders: {
      type: GraphQLInt,
      description: '股东人数'
    }
  }
})
